<?php

class SON_Forms_Login extends Zend_Form
{
    public function init()
    {
    	$this->setMethod('post');
    	
    	$email = new Zend_Form_Element_Text('email');
    	$email->setRequired(true)
	    	->addFilter('StripTags')
	    	->addFilter('StringTrim')
	    	->addValidator('NotEmpty', true, array('messages' => 'Informe um e-mail'))
	    	->addValidator('EmailAddress', true, array('messages' => 'E-mail inválido'))
	    	->setAttrib('class', 'form-control')
	    	->setAttrib('placeholder', 'E-mail')
	    	->setAttrib('required', 'required');
    	$this->addElement($email);
    	
    	$senha = new Zend_Form_Element_Password('senha');
    	$senha->setRequired(true)
	    	->addFilter('StripTags')
	    	->addFilter('StringTrim')
	    	->addValidator('NotEmpty', false, array('messages' => 'Informe uma senha'))
	    	->setAttrib('class', 'form-control')
	    	->setAttrib('placeholder', 'Senha')
	    	->setAttrib('required', 'required');
    	$this->addElement($senha);
    	
    	$email->removeDecorator('HtmlTag')->removeDecorator('Label')->removeDecorator('Errors');
    	$senha->removeDecorator('HtmlTag')->removeDecorator('Label')->removeDecorator('Errors');
    }
}